<?php
class Migration_Create_Group extends CI_Migration {
	public function up() {
		$obj = $this->dbforge;
		$fields = array (
				'ID' => array (
						'type' => 'int',
						'unsigned' => true,
						'auto_increment' => true,
						'null' => false,
						'constraint' => 11 
				),
				'NOME' => array (
						'type' => 'VARCHAR',
						'constraint' => '20',
						'default' => '' 
				),
				'HOME_PAGE' => array (
						'type' => 'VARCHAR',
						'constraint' => '150',
						'default' => '/' 
				)
				
		);
		$obj->add_key ('ID', true );
		$obj->add_field ( $fields );
		$obj->create_table ( 'groups', TRUE );
		
		
		
	}
	public function down() {
		$this->dbforge->drop_table ( 'groups' );
	}
}
